﻿using System;
using System.Net;

namespace FindProxy
{
    public class WebDownload : WebClient
    {
        public WebDownload() { this._timeout = 6000; }
        public WebDownload(int timeout) { this._timeout = timeout; }
        private int _timeout;
        /// <summary>     /// Time in milliseconds     /// </summary>   
        public int Timeout
        {
            get { return _timeout; }
            set
            {
                _timeout = value;
            }
        }
        protected override WebRequest GetWebRequest(Uri address)
        {
            var result = base.GetWebRequest(address);
            result.Timeout = this._timeout;
            return result;
        }
    }
}
